package com.aaa.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface L_CategoryDao {

    @Select("<script> select *  from point_set  "+
            " where 1=1 <if test=\"id!=null and id!=0\"> and id =#{id}</if> " +
            " <if test=\"unit!=null and unit!=''\"> and unit like concat('%',#{unit},'%')</if> " +
            " ORDER BY state ASC  limit #{start},#{pageSize}</script>")
    List<Map> getAll(Map map);

    @Select(" <script>  select count(id) from point_set " +
            "  where 1=1 <if test=\"id!=null and id!=0\"> and id =#{id}</if>" +
            " <if test=\"unit!=null and unit!=''\"> and unit like concat('%',#{unit},'%')</if></script>")
    Integer getCount(Map map);



    @Update("update point_set set state=1,endtime=#{endtime},user=#{user}  where id=#{id}")
    void on(Map map);
    @Delete("delete  from point_set where id=#{id}")
    void delete(Map map);
}
